-
Notifications
You must be signed in to change notification settings - Fork 715
Add README to Aspire.Hosting.Azure.AppService #12105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: davidfowl <[email protected]>
|
|
||
| ## Usage example | ||
|
|
||
| In the _Program.cs_ file of your AppHost project, add an Azure App Service Environment and publish your project as an Azure App Service website: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
website -> WebApp
| builder.AddProject<Projects.MyWebApp>("webapp") | ||
| .PublishAsAzureAppServiceWebsite((infrastructure, site) => | ||
| { | ||
| // Configure the App Service website | ||
| site.SiteConfig.IsWebSocketsEnabled = true; | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need .WithExternalHttpEndpoints() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot address this feedback and describe the constraints of app service:
- Only external endpoints HTTP or HTTPS based endpoints
- Can only have a single endpoint
|
@copilot implement feedback from @sarsharma |
Co-authored-by: mitchdenny <[email protected]>
Updated the README to match the conventions used in other Azure hosting packages. Changes include:
These changes align with the patterns established in Aspire.Hosting.Azure.CosmosDB, Aspire.Hosting.Azure.ApplicationInsights, and other Azure hosting packages. Commit: Will be provided after the changes are pushed. |
|
@copilot Address this feedback and describe the constraints of app service: Only external endpoints HTTP or HTTPS based endpoints. (WithExternaHttpEndpoints) |
Co-authored-by: davidfowl <[email protected]>
Added a dedicated section documenting Azure App Service constraints:
Updated all code examples to include |
|
@copilot src/Aspire.Hosting.Azure.AppService/README.md:19-34 This does not apply since this is a publish time resource only. src/Aspire.Hosting.Azure.AppService/README.md:98 Instead show the WithDashboard extension method @dotnet/aspire/files/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs |
Co-authored-by: davidfowl <[email protected]>
Removed the "Configure Azure Provisioning for local development" section since this is a publish-time resource only. Updated the dashboard configuration example to use the |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12105Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12105" |
|
|
||
| ### Prerequisites | ||
|
|
||
| - Azure subscription - [create one for free](https://azure.microsoft.com/free/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default SKU we use for AppService (P0v3) is not supported on free subscription. Remove the "create one for free" line.
| var appServiceEnvironment = builder.AddAzureAppServiceEnvironment("env") | ||
| .WithDashboard(enable: false); | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add information about Application Insights that can be enabled with WithAzureApplicationInsights extension method.
- A different location can be specified for Application Insights using the option parameter for location.
var appServiceEnvironment = builder.AddAzureAppServiceEnvironment("env")
.WithAzureApplicationInsights();There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Address this feedback
| @@ -0,0 +1,88 @@ | |||
| # Aspire.Hosting.Azure.AppService library | |||
|
|
|||
| Provides extension methods and resource definitions for a .NET Aspire AppHost to configure Azure App Service. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the compute resources (like project).
| .PublishAsAzureAppServiceWebsite((infrastructure, site) => | ||
| { | ||
| // Configure the App Service website | ||
| site.SiteConfig.IsWebSocketsEnabled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to appsettings
|
|
||
| - **External endpoints only**: App Service only supports external endpoints. All endpoints must be configured using `WithExternalHttpEndpoints()`. | ||
| - **HTTP/HTTPS only**: Only HTTP and HTTPS endpoints are supported. Other protocols are not supported. | ||
| - **Single endpoint**: App Service supports only a single target port. Resources with multiple external endpoints with different target ports are not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is 8000. TargetPort can be overriden with WithHttpEndpoint extension method.
|
|
||
| The Azure App Service Environment resource creates the underlying infrastructure needed to host your applications, including: | ||
|
|
||
| - An Azure App Service Plan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default SKU is P0v3. This can be changed with:
var appServiceEnvironment = builder.AddAzureAppServiceEnvironment("env")
.ConfigureInfrastructure((infra) =>
{
var plan = infra.GetProvisionableResources().OfType<AppServicePlan>().Single();
plan.Sku = new AppServiceSkuDescription
{
Name = "P2V3",
Tier = "Premium"
};
});|
|
||
| ```csharp | ||
| builder.AddProject<Projects.MyApi>("api") | ||
| .WithHttpEndpoint() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following extension methods:
WithHealthProbeto enable health checksWithArgsto add command line parameter
|
|
||
| ### Prerequisites | ||
|
|
||
| - Azure subscription - [create one for free](https://azure.microsoft.com/free/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that user needs to be the owner of the subscription.
|
@copilot Implement the PR feedback |
I've already addressed all the previous feedback comments:
Could you specify which additional feedback needs to be implemented? Are there inline review comments on the PR I should address? |
|
@copilot All of the comments from @ShilpiRach |
I don't have access to @ShilpiRach's comments in my context. Could you please share the specific feedback that needs to be addressed, or point me to where I can find those comments? Alternatively, you could paste the relevant feedback here so I can implement the changes. |
Co-authored-by: davidfowl <[email protected]>
This PR adds a comprehensive README.md file to the
Aspire.Hosting.Azure.AppServicepackage, providing documentation for developers on how to use this package to deploy .NET Aspire applications to Azure App Service.What's included
The README covers:
WithDashboardextension methodWithExternalHttpEndpoints())Pattern consistency
The README follows the conventions used by other Azure hosting packages in the repository, with appropriate adjustments for App Service being a publish-time resource only (no Azure provisioning configuration section included).
All code examples include the required
WithExternalHttpEndpoints()call to properly demonstrate the correct usage pattern for Azure App Service deployments, and use the properWithDashboardextension method for dashboard configuration.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.